package com.ruix.app.mapper;

import com.ruix.app.model.PostAuther;

import org.json.JSONObject;

/**
 * Created by hadexs on 2017/5/12.
 */

public class PostAutherMapper implements ApiMapper<PostAuther>{
    @Override
    public PostAuther transform(JSONObject response) {
        PostAuther postAuther = null;
        if (response != null) {
          JSONObject data =   response.optJSONObject("data");
            if (data != null){
               JSONObject author =  data.optJSONObject("author");
                if (author != null) {
                    postAuther = new PostAuther().parse(author);
                }
            }
        }
        return postAuther;
    }
}
